import request from '@/config/axios'

export interface TaskNumberVO {
        id: number
        taskId: number
        status: number
        number: string
        source: string
        sourceId: string
        sourceName: string
        callRecordId: number
}

// 查询外呼名单列表
export const getTaskNumberPage = async (params) => {
    return await request.get({url: `/call/task-number/page`, params})
}

// 查询外呼名单详情
export const getTaskNumber = async (id: number) => {
    return await request.get({url: `/call/task-number/get?id=` + id})
}

// 新增外呼名单
export const createTaskNumber = async (data: TaskNumberVO) => {
    return await request.post({url: `/call/task-number/create`, data})
}

// 修改外呼名单
export const updateTaskNumber = async (data: TaskNumberVO) => {
    return await request.put({url: `/call/task-number/update`, data})
}

// 删除外呼名单
export const deleteTaskNumber = async (id: number) => {
    return await request.delete({url: `/call/task-number/delete?id=` + id})
}

// 导出外呼名单 Excel
export const exportTaskNumber = async (params) => {
    return await request.download({url: `/call/task-number/export-excel`, params})
}